import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import { HashRouter as Router, Routes, Route } from 'react-router-dom';
import { mainRoutes } from './routes';
import reportWebVitals from './reportWebVitals';
import App from './App';

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
  <Router>
    <Routes>
      <Route path="/admin/*" element={<App />} />
      {
        mainRoutes.map(route => {
          return <Route key={route.path} path={route.path} element={route.Element} />
        })
      }
    </Routes>
  </Router>
);
reportWebVitals();
